package cn.wjdiankong.levideo.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Window;
import android.widget.TextView;
import cn.wjdiankong.levideo.R;

public class CrashLogActivity extends BaseActivity{

    private TextView contentTextView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_crash_log);
        initView();
        initData();
    }

    public void initView(){
        super.initView();
        contentTextView = (TextView)findViewById(R.id.txt);
    }

    @Override  
	public boolean onKeyDown(int keyCode, KeyEvent event) {  
	    if(keyCode == KeyEvent.KEYCODE_BACK)  {    
	    	finish();
	    	android.os.Process.killProcess(android.os.Process.myPid());
	    }
	    return false;
	} 
    
    protected void initData(){
    	super.initData();
        setTitle("崩溃日志");
        Intent intent = getIntent();
        contentTextView.setText(intent.getStringExtra("_content"));
    }

    public static void startDefault(Context context, String content){
    	Intent intent = new Intent(context, CrashLogActivity.class);
        intent.putExtra("_content",content);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }
    
    @Override
	protected String getPageName() {
		return "crash";
	}

}
